package ar.edu.itba.pod.Legajo47342;

import java.net.UnknownHostException;
import java.rmi.RemoteException;

import ar.edu.itba.pod.Legajo47342.communication.ConnectionManagerImpl;
import ar.edu.itba.pod.simul.ObjectFactory;
import ar.edu.itba.pod.simul.communication.ConnectionManager;
import ar.edu.itba.pod.simul.market.MarketManager;
import ar.edu.itba.pod.simul.simulation.SimulationManager;
import ar.edu.itba.pod.simul.time.TimeMapper;

public class ObjectFactoryImpl implements ObjectFactory {

	@Override
	public ConnectionManager createConnectionManager(String localIp) {
		ConnectionManager manager;
		
		try {
			manager = new ConnectionManagerImpl(new Node(localIp));
			
			return manager;
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return null;
	}

	@Override
	public ConnectionManager createConnectionManager(String localIp,
			String groupIp) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public MarketManager getMarketManager(ConnectionManager mgr) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public SimulationManager getSimulationManager(ConnectionManager mgr,
			TimeMapper timeMappers) {
		// TODO Auto-generated method stub
		return null;
	}

}
